Are Virtual Threads Going to Make Reactive Programming Irrelevant?
José Paumard on October 28, 2024Java 21 was released about a year ago, and among all the features that this version brings, Loom virtual threads are probably the most exciting and promising one. One of the promise was to enable the “simple thread-per-request style to scale with near-optimal hardware utilization”, something that could only be achieved by reactive style programming. How can virtual threads achieve this kind of performance? Can virtual threads make the asynchronous programming model obsolete? Is this model going to disappear? These are the questions we cover in this presentation.
Virtual threads are cheap to create, to a point where you can have as many as you need. It allows for a new API, Structured Concurrency, that brings a new asychronous programming model, simpler than the reactive programming model. The last element you need to create complete applications are Scoped Values, a replacement of Thread local variables, that we also cover.
Recorded at Javazone 2024.